package com.lxd.entity.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Date;
import com.lxd.entity.enums.DateTimePatternEnum;
import com.lxd.utils.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;


/**
 * 文件表
 */
public class File implements Serializable {


	/**
	 * 文件ID
	 */
	private Long id;

	/**
	 * 文件名
	 */
	private String fileName;

	/**
	 * 文件路径
	 */
	private String filePath;

	/**
	 * 文件类型
	 */
	private String fileType;

	/**
	 * 文件大小
	 */
	private Long fileSize;

	/**
	 * 上传者ID
	 */
	private Long uploadedBy;

	/**
	 * 上传时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date uploadedAt;

	/**
	 * 关联类型（0：activity,1:news）
	 */
	private Integer relatedType;

	/**
	 * 关联类型对应的id
	 */
	private Long relatedId;


	public void setId(Long id){
		this.id = id;
	}

	public Long getId(){
		return this.id;
	}

	public void setFileName(String fileName){
		this.fileName = fileName;
	}

	public String getFileName(){
		return this.fileName;
	}

	public void setFilePath(String filePath){
		this.filePath = filePath;
	}

	public String getFilePath(){
		return this.filePath;
	}

	public void setFileType(String fileType){
		this.fileType = fileType;
	}

	public String getFileType(){
		return this.fileType;
	}

	public void setFileSize(Long fileSize){
		this.fileSize = fileSize;
	}

	public Long getFileSize(){
		return this.fileSize;
	}

	public void setUploadedBy(Long uploadedBy){
		this.uploadedBy = uploadedBy;
	}

	public Long getUploadedBy(){
		return this.uploadedBy;
	}

	public void setUploadedAt(Date uploadedAt){
		this.uploadedAt = uploadedAt;
	}

	public Date getUploadedAt(){
		return this.uploadedAt;
	}

	public void setRelatedType(Integer relatedType){
		this.relatedType = relatedType;
	}

	public Integer getRelatedType(){
		return this.relatedType;
	}

	public void setRelatedId(Long relatedId){
		this.relatedId = relatedId;
	}

	public Long getRelatedId(){
		return this.relatedId;
	}

	@Override
	public String toString (){
		return "文件ID:"+(id == null ? "空" : id)+"，文件名:"+(fileName == null ? "空" : fileName)+"，文件路径:"+(filePath == null ? "空" : filePath)+"，文件类型:"+(fileType == null ? "空" : fileType)+"，文件大小:"+(fileSize == null ? "空" : fileSize)+"，上传者ID:"+(uploadedBy == null ? "空" : uploadedBy)+"，上传时间:"+(uploadedAt == null ? "空" : DateUtil.format(uploadedAt, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()))+"，关联类型（0：activity,1:news）:"+(relatedType == null ? "空" : relatedType)+"，关联类型对应的id:"+(relatedId == null ? "空" : relatedId);
	}
}
